<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, shrink-to-fit=no,viewport-fit=cover">
    <meta name="format-detection" content="telephone=no,email=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="default">
    <meta name="full-screen" content="yes">
    <meta name="x5-fullscreen" content="true">
    <title>党史天天学 | 知识竞答</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="applicable-device" content="pc,mobile">
    <script>
        /*rem适配*/
        (function (deviceWidth) {
            var root = document.documentElement;
            var w = root.clientWidth;
            root.style.fontSize = (w > 720 ? 720 : w < 320 ? 320 : w) / deviceWidth * 100 + "px";
        })(750);
        if (typeof WeixinJSBridge == "object" && typeof WeixinJSBridge.invoke == "function") {
            handleFontSize();
            } else {
            if (document.addEventListener) {
            　　　　document.addEventListener("WeixinJSBridgeReady", handleFontSize, false);
            　　} else if (document.attachEvent) {
            　　　　document.attachEvent("WeixinJSBridgeReady", handleFontSize);
            　　　　document.attachEvent("onWeixinJSBridgeReady", handleFontSize);
            　　}
            }
            function handleFontSize() {
            　　// 设置网页字体为默认大小
            　　WeixinJSBridge.invoke('setFontSizeCallback', {'fontSize': 0});
            　　// 重写设置网页字体大小的事件
            　　WeixinJSBridge.on('menu:setfont', function () {
                WeixinJSBridge.invoke('setFontSizeCallback', {'fontSize': 0});
            });
            }
    </script>
    <link rel="stylesheet" href="https://www.12371.cn/mydsjd/h5/css/guess.css">
    <script src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
    <script src="https://www.12371.cn/mydsjd/h5/js/wxshare.js"></script>
</head>

<body>
    <div class="container">
        <!-- 顶部导航 -->
        <div class="top_nav_box">
            <div class="goback_btn concol" id="concol"></div>
            <p class="nav_title">竞答结果</p>
        </div>
        <div class="guess_score_box">
            <div class="yellow_box">
                <p class="gsb_title">本次答题成绩</p>
                <p class="gsb_score"><span class="score_num">{{$test->test_score }}</span><span>分</span></p>
                <!-- <p class="gsb_max">本期最高得分：<span>100</span>分</p> -->
            </div>
        </div>
        <!-- 未拿到满分有错题时 -->
        <div class="content_box" style="height: 100%;">
            <div class="problem_error_box">
                <p class="error_title">错题统计</p>

                @foreach($questions as $question)
                <div>
                    <p class="error_info">{{ $loop->iteration }}. {{ $question->question }}</p>
                    <!-- normal没有选择的正常选项 error选择的错误选项 right正确答案-->
                    <ul class="error_list">
                        <li class=" el_list {{ in_array('1', $question->answer_array ?? []) ? 'right' : 'normal' }} {{ in_array('1', $question->user_answer ?? []) ? 'error' : '' }}">
                            <div class="error_right_img"></div>
                            <p class="error_right_info">A. {{ $question->option_1 }}</p>
                        </li>
                        <li  class=" el_list {{ in_array('2', $question->answer_array ?? []) ? 'right' : 'normal' }} {{ in_array('2', $question->user_answer ?? []) ? 'error' : '' }}">
                            <div class="error_right_img"></div>
                            <p class="error_right_info">B. {{ $question->option_2 }}</p>
                        </li>
                        @if($question->option_3)
                        <li  class=" el_list {{ in_array('3', $question->answer_array ?? []) ? 'right' : 'normal' }} {{ in_array('3', $question->user_answer ?? []) ? 'error' : '' }}">
                            <div class="error_right_img"></div>
                            <p class="error_right_info">C. {{ $question->option_3 }}</p>
                        </li>
                        @endif
                        @if($question->option_4)
                        <li  class=" el_list {{ in_array('4', $question->answer_array ?? []) ? 'right' : 'normal' }} {{ in_array('4', $question->user_answer ?? []) ? 'error' : '' }}">
                            <div class="error_right_img"></div>
                            <p class="error_right_info">D. {{ $question->option_4 }}</p>
                        </li>
                        @endif
                    </ul>
                </div>
                @endforeach
                <div class="peb_btn_box">
                    <div class="back_btn concol" id="concol">返回</div>
                    <div class="shareHandle share_btn">分享</div>
                </div>
            </div>
        </div>
        <!-- 全部答对无错题时 -->
        <div class="all_right_box" style="display: none;">
            <div class="arb_back concol" id="concol">返回</div>
            <div class="shareHandle arb_share">分享</div>
        </div>
    </div>

    <!-- 分享蒙层 -->
    <div class="guess_share_mask" style="display: none;">
        <div class="guess_share_style">
            <!-- 右上角分享按钮 -->
            <div class="share_friend_btn"></div>
            <p class="share_friend_info">点击右上角【…】分享给好友，一起来挑战吧</p>
        </div>
    </div>

<script>
var pagecode="T-003-000-000";
with(document)with(body)with(insertBefore(createElement("script"),firstChild))setAttribute("exparams","v_id=&aplus&page_code="+pagecode,id="tb-beacon-aplus",src=(location>"https"?"//js":"//js")+".data.cctv.com/__aplus_plugin_cctv.js,aplus_plugin_aplus_u.js")
</script>
</body>
<script src="https://www.12371.cn/mydsjd/h5/js/jquery-2.1.1.min.js"></script>
<script>
	var title = '我参加了“党史天天学”知识竞答，快来挑战我吧！';
	getShare(title);
    // 点击分享结果按钮---弹出分享蒙层
    $('.shareHandle').click(function () {
        $('.guess_share_mask').show();
    })
    $('.guess_share_mask').click(function(){
        $('.guess_share_mask').hide();
    });
    $('.concol').click(function(){
        window.location.href = '{{ route('index') }}';
    });

</script>

</html>
